package sk.openit.hibernate.entities;

// Generated 17.8.2011 17:02:48 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Project generated by hbm2java
 */
@Entity
@Table(name = "Project", catalog = "skolenie")
public class Project implements java.io.Serializable {

	private int id;
	private Client client;
	private Manager manager;
	private String name;
	private String startDate;
	private Integer length;
	private Double budget;
	private Integer projectType;
	private Set employees = new HashSet(0);

	public Project() {
	}

	public Project(int id) {
		this.id = id;
	}

	public Project(int id, Client client, Manager manager, String name,
			String startDate, Integer length, Double budget,
			Integer projectType, Set employees) {
		this.id = id;
		this.client = client;
		this.manager = manager;
		this.name = name;
		this.startDate = startDate;
		this.length = length;
		this.budget = budget;
		this.projectType = projectType;
		this.employees = employees;
	}

	@Id
	@Column(name = "ID", unique = true, nullable = false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ClientID")
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ManagerID")
	public Manager getManager() {
		return this.manager;
	}

	public void setManager(Manager manager) {
		this.manager = manager;
	}

	@Column(name = "Name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "StartDate", length = 10)
	public String getStartDate() {
		return this.startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	@Column(name = "Length")
	public Integer getLength() {
		return this.length;
	}

	public void setLength(Integer length) {
		this.length = length;
	}

	@Column(name = "Budget", precision = 53, scale = 0)
	public Double getBudget() {
		return this.budget;
	}

	public void setBudget(Double budget) {
		this.budget = budget;
	}

	@Column(name = "ProjectType")
	public Integer getProjectType() {
		return this.projectType;
	}

	public void setProjectType(Integer projectType) {
		this.projectType = projectType;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "ProjectEmployees", catalog = "skolenie", joinColumns = { @JoinColumn(name = "ProjectID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "EmployeeID", nullable = false, updatable = false) })
	public Set<Employee> getEmployees() {
		return this.employees;
	}

	public void setEmployees(Set employees) {
		this.employees = employees;
	}

}
